<script>
$(document).ready(function(){

  $("div#dlgCategoria form").bind('success',function(e){
	 $(this).parents("div.dialog").dialog('close');
	 var frm = this;
	 var fn = $(frm).data("callback")
	 if ( typeof(fn) == 'function' ) fn();
  });

});
</script>

<div id="dlg{$module.name}" class="dialog" title="{$module.form.title}">
<form class="ajax form" action="index.php/categoria/save" >
	{foreach from=$module.form.fields item="c"}
		{widget widget=$c}
	{/foreach}
	<input type="hidden" name="{$module.form.pk}" value="-1" />
	<input type="hidden" name="ajax" value="ajax" />
<div class="actions">
  <input type="submit" value="Guardar" />
</div>
</form>

</div>
